#!/bin/bash

set -o nounset

# We are started in the doc/ dir, but let's use the parent dir.
FLY_OUT=../_tmp/out

build() {
  set -o errexit

  # URL:
  # /projects/fly/
  # /projects/fly/command-help
  # /projects/fly/fly.html

  # TODO: Depends on parent
  $FLY_OUT/fly.tin --help > $OUT/command-help

  # TODO: Should app go at the root?
  cp --verbose App $OUT
  asciidoc \
    --out-file $OUT/fly.html \
    fly.txt 
  asciidoc \
    --out-file $OUT/index.html \
    index.txt 
}

build
